from appengine_django.models import BaseModel
from google.appengine.ext import db

class FavoritePerson (BaseModel):
    nickname = db.StringProperty()
    pub_date = db.DateTimeProperty('date added')

class ConceptHumanRelation():
    concept = ""
    ppl = []
    
    def __init__(self, concept, ppl=[]):
        self.concept = concept
        self.ppl = ppl
    
    def get_concept(self):
        return concept
    
    def get_related_people(self):
        return self.ppl
    
    def has_people(self):
        return len(self.ppl) > 0
    
    def has_person(self, person):
        return self.ppl.__contains__(person)
    
    def add_person(self, person):
        if not self.has_person(person):
            self.ppl.append(person)
            


class Entry():
    name = ""
    content = ""
    update_time = ""
    
    def __init__(self, name, content, update_time):
        self.name = name
        self.content = content
        self.update_time = update_time
        
    